#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int dp[maxn][20], last[20], co[maxn];
int main() {
  ios::sync_with_stdio(false);
  int n, m, x, y;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> co[i];
  memset(dp, 0x3f, sizeof dp);
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < 19; j++) {
      if (co[i] & (1 << j)) {
        for (int k = 0; k < 19; k++) dp[i][k] = min(dp[i][k], dp[last[j]][k]);
        dp[i][j] = last[j] = i;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    int flag = 0;
    for (int j = 0; j < 19; j++) {
      if (!(co[y] & (1 << j))) continue;
      if (dp[x][j] > y) continue;
      flag = 1;
    }
    if (flag)
      cout << "Shi" << endl;
    else
      cout << "Fou" << endl;
  }
}
