#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, q, a[300500], dp[300500][30], best[300500][30], last[30];
int f(int x, int bt) {
  if (a[x] & (1 << bt)) return x;
  if (dp[x][bt] != -1) return dp[x][bt];
  int mn = 1e9;
  for (int i = 0; i <= 27; i++) {
    if (a[x] & (1 << i) && best[x][i] != 1e9) mn = min(mn, f(best[x][i], bt));
  }
  return dp[x][bt] = mn;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(dp, -1, sizeof dp);
  for (int i = 0; i <= 27; i++) last[i] = 1e9;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j <= 27; j++) best[i][j] = 1e9;
    for (int j = 0; j <= 27; j++) {
      best[i][j] = last[j];
      if ((a[i] & (1 << j))) last[j] = i;
    }
  }
  while (q--) {
    int x, y, ans = 0;
    cin >> x >> y;
    x--, y--;
    for (int i = 0; i <= 27; i++) {
      if ((a[y] & (1 << i)) && f(x, i) <= y) ans = 1;
    }
    if (ans)
      cout << "Shi" << endl;
    else
      cout << "Fou" << endl;
  }
}
